﻿<!-- saved from url=(0014)about:internet -->
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Chunk upload example</title>
	<link rel="stylesheet" href="styles.css">
</head>
<body>
Sample: <b>chunkupload.html</b>&nbsp;&nbsp;<a href="javascript:location.reload(true);"><img border="0" src="images/refresh.png" width="16" height="16">&nbsp;Refresh frame</a>&nbsp;&nbsp;<a target="_parent" href="index.htm"><img border="0" src="images/home.png" width="16" height="16">&nbsp;Examples home</a><br/><br/>
	<!-- text below wil be shown if JavaScript disabled at browser -->
 <span id="noscriptdiv" style="border:1px  solid #FF0000;display:block;padding:5px;text-align:left; background: #FDF2F2;color:#000;">Active Scripting (JavaScript) should be enabled in your browser for this application to function properly!</span>
<script type="text/javascript">
	document.getElementById('noscriptdiv').style.visibility = 'hidden';
	document.getElementById('noscriptdiv').style.height = 0;
	document.getElementById('noscriptdiv').style.padding = 0;
	document.getElementById('noscriptdiv').style.border = 0;
</script>

This is example of chunk upload. Each file can be uploaded my small chunks. 

This way has some advantages:
<ul>
<li>Large files can be uploaded and you don't need to increase request size settings at php.ini or web.config, etc. You can set max size of chunk 2 MB - such sample will work with default server settings.</li>
<li>No cookie pass Adove Flash bug. If you upload by chunks firefox send cookies correctly. Most competitive Flash upload controls uploads whole file in request and therefor has cookie bug. See more info at <a target="_blank" href="Documentation/MultiPowUpload_Manual_HTML/Troubleshooting.html#session">Lost session or authentication info</a> inside troubleshooting.</li>
<li>Resumable upload starting from last uploaded chunk. MultiPowUpload uploades fils even is Internet connection is broken for some time.</li>
<li>User can stop upload and continue uploading from last chunk.</li>
</ul>

<br/>
For uploading by chunks file is loaded to the RAM. Adobe Flash guarantees 100 MB files uploading by this method but at most PC files even 500 MB works correctly. MultiPowUpload shows warning window if file is too large for chunk upload.

<p>For the  example you need to specify script URL that accept the files. Open the example  in a text editor and specify the property value &quot;uploadUrl&quot; of  MultiPowUpload object. The value can be:</p>

<ul>
  <li>For PHP : <code>FileProcessingScripts/PHP/chunkupload.php</code>&nbsp;<strong>(Default value)</strong></li>
  <li>For ASP.NET (C Sharp): <code>FileProcessingScripts/ASP.NET/CSharp/chunkupload.aspx</code></li>
<li>For ASP.NET (VB): <code>FileProcessingScripts/ASP.NET/VBNET/chunkupload.aspx</code></li>
</ul>


<br>Chunk upload method :<br>			
			<select id="watermark_style"onChange="javascript: setChunkedUploadMethod(this);"/>				
				<option value="true" selected>Raw method</option>
				<option value="false">Multipart method</option>
			</select>
<br>
			
<div id="MultiPowUpload_holder">
<strong>You need at least 10 version of Flash player!</strong>
<a href="http://www.adobe.com/go/getflashplayer">&nbsp;<img border="0" src="images/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
</div>
<!-- SWFObject home page: http://code.google.com/p/swfobject/
You can replace src value with the http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js (Most users has such file cached)
 -->
<script type="text/javascript" src="Extra/swfobject.js"></script>
<script type="text/javascript">
	var params = {  
		BGColor: "#FFFFFF"
	};
	
	var attributes = {  
		id: "MultiPowUpload",  
		name: "MultiPowUpload"
	};
	
	var flashvars = {
	  "serialNumber": "put your serial number here",
	  "uploadUrl": "FileProcessingScripts/PHP/chunkupload.php",
	  "useExternalInterface": "true",	  
	  "chunkedUpload.enabled" : "true",
	  "chunkedUpload.rawMethod": "true",
	  "chunkedUpload.chunkSize": "-1",
	  "chunkedUpload.maxChunkSize": "2097152",
	  "fileFilter.maxSize":"-1"

	};

	swfobject.embedSWF("ElementITMultiPowUpload.swf", "MultiPowUpload_holder", "400", "250", "10.0.0", "Extra/expressInstall.swf", flashvars, params, attributes);
</script>
<script type="text/javascript">
	function setChunkedUploadMethod(obj)
	{	
		MultiPowUpload.setParameter("chunkedUpload.rawMethod", obj.options[obj.selectedIndex].value);	
	}
</script>
<br />
The file uploader doesn’t work? See <a target="_blank" href="http://www.element-it.com/OnlineHelpMulti/MultiPowUpload_Manual_HTML/Troubleshooting.html">here</a> what you need for its proper work. 

</body>
</html>